﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.IO;
namespace AuctionHouseClient
{
    class ClientThreads
    {
        public event ReceiveClient ClientReceivedEvent;

        public void ReceivedClientInput(object binaryReaderObj)
        {
            byte client;
            BinaryReader binaryReader = (BinaryReader)binaryReaderObj;

            while (true)
            {
                try
                {
                  
                    client = binaryReader.ReadByte();	// Læs fra server til Klient
                    if (client.ToString() != "") 
                    {
                    
                    }
                }
                catch (IOException)		// Udløses når streamreader lukkes ned af main-thread (bruger logger ud)
                {
                    break;
                }

                ClientReceivedEvent(client.ToString());
            }
        }
       
    }
}
